
const system = uni.getSystemInfoSync()
let capsule = {}
// #ifdef MP
capsule = uni.getMenuButtonBoundingClientRect()
// #endif
// #ifndef MP
capsule = {
  bottom: 38,
  height: 32,
  top: 6,
  width: 87
}
capsule.right = system.safeArea.width - 7
capsule.left = capsule.right - capsule.width
// #endif

const menuButtonLeft = system.safeArea.width - capsule.right
const navbarTitleWidth = system.safeArea.width - (capsule.width + menuButtonLeft * 2) * 2
const navbarHeight = (capsule.top - system.statusBarHeight) * 2 + capsule.height
let navbarFlexWidth = system.safeArea.width - (capsule.width + menuButtonLeft * 3)

const navbarStyle = {
  menuButtonLeft: menuButtonLeft,
  menuButtonWidth: capsule.width,
  menuButtonHeight: capsule.height,
  titleWidth: navbarTitleWidth,
  flexWidth: navbarFlexWidth,
  height: navbarHeight
}

const tabbarHeight = 51
export default {
  system,
  capsule,
  navbarStyle,
  tabbarHeight,
  navbarPlaceholder: navbarHeight + system.statusBarHeight,
  tabbarPlaceholder: system.safeAreaInsets.bottom + tabbarHeight
}
